package com.hrprojectback.service.impl.XinXiGuanLiServiceImpl;

import com.hrprojectback.dto.Department;
import com.hrprojectback.dto.DepertmentPCode;
import com.hrprojectback.mapper.DepartmentMapper;
import com.hrprojectback.service.XinXiGuanLiService.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements DepartmentService {
    @Autowired
    private DepartmentMapper departmentMapper;

    @Override
    public List<Department> getDepartment(String code, String name, int pageStart, int pageSize) {
        List<Department> departments = departmentMapper.getDepartment(code, name, pageStart, pageSize);
        return departments;
    }

    @Override
    public List<Department> selectDepartmentNameTrees(Department department) {
        List<Department> departments = departmentMapper.selectDepartmentNameTrees(department);
        return departments;
    }

    @Override
    public List<DepertmentPCode> selectDepartmentPCodeTrees(DepertmentPCode depertmentPCode) {
        List<DepertmentPCode> depertmentPCodes = departmentMapper.DepertmentPCode(depertmentPCode);
        return depertmentPCodes;
    }

    @Override
    public Integer getDeptCounts(String code, String name) {
        Integer deptCounts = departmentMapper.getDeptCounts(code, name);
        return deptCounts;
    }

    @Override
    public int addDept(Department department) {
        int i = departmentMapper.addDept(department);
        return i;
    }

    @Override
    public Department geteditDepartment(String code) {
        Department geteditDept = departmentMapper.geteditDepartment(code);
        return geteditDept;
    }

    @Override
    public int editDept(Department department) {
        int i = departmentMapper.editDept(department);
        return i;
    }

    @Override
    public int deleteDept(String code) {
        int i = departmentMapper.deleteDept(code);
        return i;
    }

    @Override
    public int YiShiXiAo(String code) {
        int i = departmentMapper.YiShiXiAo(code);
        return i;
    }

    @Override
    public int YiQiYong(String code) {
        int i = departmentMapper.YiQiYong(code);
        return i;
    }

    @Override
    public int getStatus(String code) {
        int status = departmentMapper.getStatus(code);
        return status;
    }

}
